package com.nfIt.sumThread;

/**
 * ClossName:SumThread
 * Pakage:com.nfIt
 * Description
 *
 * @Author L
 * @Create 2024/3/20 8:35
 * @Version 2023.1.3
 */
public class SumThread extends Thread{
    private int m;
    private int n;

    private int sum;

    public int getM() {
        return m;
    }

    public void setM(int m) {
        this.m = m;
    }

    public int getN() {
        return n;
    }

    public void setN(int n) {
        this.n = n;
    }


    public SumThread() {
    }

    public SumThread(int m, int n) {
        this.m = m;
        this.n = n;
    }



    public void run(){
        for (int i = m ; i <= n ; i++){
            sum+=i;
        }
    }

    public int getSum(){
        return sum;
    }

}
